package com.kjsb.dao;


import com.kjsb.entity.Unit;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UnitDao {
    @Update("update unit set uid = #{uid} , unitname = #{unitname} , address = #{address} , corporation = #{corporation} , investment = #{investment} ,type= #{type} , tel= #{tel} , email = #{email} , fax = #{fax} , zipcode = #{zipcode} , introduction = #{introduction} where unitid = #{unitid}")
    public int updateUnits(Unit unit);
    @Delete("delete from unit where unitid = #{unitid}")
    public int deleteUnits(Integer unitid);
    @Select("select unitid,uid,unitname,address,corporation,investment,type,tel,introduction from unit")
    public List<Unit> getAllUnits();
    @Select("select * from unit where uid = #{uid}")
    public Unit getByUId(Integer uid);
}
